xtset orgid
**cd "C:\Documents and Settings\PeterH\My Documents\Political Science\Papers\Ancient Fire\Outputs"**
**use with no unknowns dataset.**

***main***
xtgee logdead1 religiousgroup muslimgroups ddbyyear ethnicity cibyyear hdioldirqafg emin5_ occupied unknown , robust
outreg2 using mainmodels.doc, word dec(2)  label
xtgee logdead1 religiousgroup ethnoreligious muslimgroups ddbyyear ethnicity cibyyear hdioldirqafg emin5_ occupied unknown, robust
outreg2 using mainmodels.doc, word dec(2) append  label
xtgee logdead1 religiousgroup fund muslimgroups ddbyyear cibyyear ethnicity hdioldirqafg emin5_ occupied unknown, robust
outreg2 using mainmodels.doc, word dec(2) append  label
xtgee logdead1 ethnoreligious  muslimgroups ddbyyear cibyyear ethnicity hdioldirqafg emin5_ occupied unknown, robust
outreg2 using mainmodels.doc, word dec(2) append label
xtgee logdead1 fund muslimgroups ddbyyear cibyyear ethnicity hdioldirqafg emin5_ occupied unknown, robust
outreg2 using mainmodels.doc, word dec(2) append label

**robustness checks**
**with group size.**
xtgee logdead1 religiousgroup muslimgroups ddbyyear ethnicity cibyyear hdioldirqafg emin5_ occupied ordsize , robust
outreg2 using robustnessgroupsize.doc, word dec(2) label
xtgee logdead1 religiousgroup ethnoreligious muslimgroups ddbyyear ethnicity cibyyear hdioldirqafg emin5_ occupied ordsize , robust
outreg2 using robustnessgroupsize.doc, word dec(2) label
xtgee logdead1 religiousgroup fund muslimgroups ddbyyear ethnicity cibyyear hdioldirqafg emin5_ occupied ordsize , robust
outreg2 using robustnessgroupsize.doc, word dec(2) label

xtgee logdead1 religiousgroup muslimgroups ddbyyear ethnicity cibyyear hdioldirqafg emin5_ occupied ordsizev2 , robust
outreg2 using robustnessgroupsize2.doc, word dec(2) label
xtgee logdead1 religiousgroup ethnoreligious muslimgroups ddbyyear ethnicity cibyyear hdioldirqafg emin5_ occupied ordsizev2 , robust
outreg2 using robustnessgroupsize2.doc, word dec(2) label
xtgee logdead1 religiousgroup fund muslimgroups ddbyyear ethnicity cibyyear hdioldirqafg emin5_ occupied ordsizev2 , robust
outreg2 using robustnessgroupsize2.doc, word dec(2) label


**successful attacks only
xtgee logdead1 religiousgroup muslimgroups ethnicity ddbyyear cibyyear hdioldirqafg emin5_ occupied unknown if success==1, robust family(gaussian) link(identity) corr(exc)
outreg2 using successful.doc, word se dec(2) label
 xtgee logdead1 religiousgroup ethnoreligious muslimgroups ethnicity ddbyyear cibyyear hdioldirqafg emin5_ occupied unknown if success==1, robust family(gaussian) link(identity) corr(exc)
outreg2 using successful.doc, word se append dec(2) label
xtgee logdead1 religiousgroup fund muslimgroups ethnicity ddbyyear cibyyear hdioldirqafg emin5_ occupied unknown if success==1, robust family(gaussian) link(identity) corr(exc)
outreg2 using successful.doc, word se append dec(2) label

**without EF
xtgee logdead1 religiousgroup muslimgroups  ddbyyear cibyyear hdioldirqafg emin5_ occupied, robust family(gaussian) link(identity) corr(exc)
outreg2 using noEF.doc, word se dec(2) label
 xtgee logdead1 religiousgroup  ethnoreligious muslimgroups ddbyyear cibyyear hdioldirqafg emin5_ occupied, robust family(gaussian) link(identity) corr(exc)
outreg2 using noEF.doc, word se dec(2) label
xtgee logdead1 religiousgroup fund muslimgroups  ddbyyear cibyyear hdioldirqafg emin5_ occupied, robust family(gaussian) link(identity) corr(exc)
outreg2 using noEF.doc, word se dec(2) label

**for Model1**
xtgee logdead1 religiousgroup muslimgroups ethnicity ddbyyear cibyyear hdioldirqafg emin5_ occupied unknown if israelpalestine==0, robust family(gaussian) link(identity) corr(exc)
outreg2 using Model1robustness.doc, word se dec(2)label
xtgee logdead1 religiousgroup muslimgroups ethnicity ddbyyear cibyyear hdioldirqafg emin5_ occupied unknown if afghanistan==0, robust family(gaussian) link(identity) corr(exc)
outreg2 using Model1robustness.doc, word se append dec(2) label
 xtgee logdead1 religiousgroup muslimgroups ethnicity ddbyyear cibyyear hdioldirqafg emin5_ occupied unknown if iraq==0, robust family(gaussian) link(identity) corr(exc)
outreg2 using Model1robustness.doc, word se append dec(2) label
 xtgee logdead1 religiousgroup muslimgroups ethnicity ddbyyear cibyyear hdioldirqafg emin5_ occupied unknown if srilanka==0, robust family(gaussian) link(identity) corr(exc)
outreg2 using Model1robustness.doc, word se append dec(2)label
 xtgee logdead1 religiousgroup muslimgroups ethnicity ddbyyear cibyyear hdioldirqafg emin5_ occupied unknown if indiakashmir==0, robust family(gaussian) link(identity) corr(exc)
outreg2 using Model1robustness.doc, word se append dec(2) label
 xtgee logdead1 religiousgroup muslimgroups ethnicity ddbyyear cibyyear hdioldirqafg emin5_ occupied unknown if intertrans==0, robust family(gaussian) link(identity) corr(exc)
outreg2 using Model1robustness.doc, word se append dec(2) label
 xtgee logdead1 religiousgroup muslimgroups ethnicity ddbyyear cibyyear hdioldirqafg emin5_ occupied unknown if unitedstates==0, robust family(gaussian) link(identity) corr(exc)
outreg2 using Model1robustness.doc, word se append dec(2) label
 
**for Model2**
xtgee logdead1 religiousgroup ethnoreligious muslimgroups ethnicity ddbyyear cibyyear hdioldirqafg emin5_ occupied unknown if israelpalestine==0, robust family(gaussian) link(identity) corr(exc)
outreg2 using Model2robustness.doc, word se dec(2)label
xtgee logdead1 religiousgroup ethnoreligious muslimgroups ethnicity ddbyyear cibyyear hdioldirqafg emin5_ occupied unknown if afghanistan==0, robust family(gaussian) link(identity) corr(exc)
outreg2 using Model2robustness.doc, word se append dec(2) label
 xtgee logdead1 religiousgroup ethnoreligious muslimgroups ethnicity ddbyyear cibyyear hdioldirqafg emin5_ occupied unknown if iraq==0, robust family(gaussian) link(identity) corr(exc)
outreg2 using Model2robustness.doc, word se append dec(2) label
 xtgee logdead1 religiousgroup ethnoreligious muslimgroups ethnicity ddbyyear cibyyear hdioldirqafg emin5_ occupied unknown if srilanka==0, robust family(gaussian) link(identity) corr(exc)
outreg2 using Model2robustness.doc, word se append dec(2)label
 xtgee logdead1 religiousgroup ethnoreligious muslimgroups ethnicity ddbyyear cibyyear hdioldirqafg emin5_ occupied unknown if indiakashmir==0, robust family(gaussian) link(identity) corr(exc)
outreg2 using Model2robustness.doc, word se append dec(2) label
 xtgee logdead1 religiousgroup ethnoreligious muslimgroups ethnicity ddbyyear cibyyear hdioldirqafg emin5_ occupied unknown if intertrans==0, robust family(gaussian) link(identity) corr(exc)
outreg2 using Model2robustness.doc, word se append dec(2) label
 xtgee logdead1 religiousgroup ethnoreligious muslimgroups ethnicity ddbyyear cibyyear hdioldirqafg emin5_ occupied unknown if unitedstates==0, robust family(gaussian) link(identity) corr(exc)
outreg2 using Model2robustness.doc, word se append dec(2) label

**for Model3**
xtgee logdead1 religiousgroup fund muslimgroups ethnicity ddbyyear cibyyear hdioldirqafg emin5_ occupied unknown if israelpalestine==0, robust family(gaussian) link(identity) corr(exc)
outreg2 using Model3robustness.doc, word se dec(2)label
xtgee logdead1 religiousgroup fund muslimgroups ethnicity ddbyyear cibyyear hdioldirqafg emin5_ occupied unknown if afghanistan==0, robust family(gaussian) link(identity) corr(exc)
outreg2 using Model3robustness.doc, word se append dec(2) label
 xtgee logdead1 religiousgroup fund muslimgroups ethnicity ddbyyear cibyyear hdioldirqafg emin5_ occupied unknown if iraq==0, robust family(gaussian) link(identity) corr(exc)
outreg2 using Model3robustness.doc, word se append dec(2) label
 xtgee logdead1 religiousgroup fund muslimgroups ethnicity ddbyyear cibyyear hdioldirqafg emin5_ occupied unknown if srilanka==0, robust family(gaussian) link(identity) corr(exc)
outreg2 using Model3robustness.doc, word se append dec(2)label
 xtgee logdead1 religiousgroup fund muslimgroups ethnicity ddbyyear cibyyear hdioldirqafg emin5_ occupied unknown if indiakashmir==0, robust family(gaussian) link(identity) corr(exc)
outreg2 using Model3robustness.doc, word se append dec(2) label
 xtgee logdead1 religiousgroup fund muslimgroups ethnicity ddbyyear cibyyear hdioldirqafg emin5_ occupied unknown if intertrans==0, robust family(gaussian) link(identity) corr(exc)
outreg2 using Model3robustness.doc, word se append dec(2) label
 xtgee logdead1 religiousgroup fund muslimgroups ethnicity ddbyyear cibyyear hdioldirqafg emin5_ occupied unknown if unitedstates==0, robust family(gaussian) link(identity) corr(exc)
outreg2 using Model3robustness.doc, word se append dec(2) label
 
**with unknowns**
xtgee logdead1 religiousgroup muslimgroups ddbyyear ethnicity cibyyear hdioldirqafg emin5_ occupied unknown, robust
outreg2 using unknowns.doc, word dec(2)  label
xtgee logdead1 religiousgroup ethnoreligious muslimgroups ddbyyear ethnicity cibyyear hdioldirqafg emin5_ occupied unknown, robust
outreg2 using unknowns.doc, word dec(2) append  label
xtgee logdead1 religiousgroup fund muslimgroups ddbyyear cibyyear ethnicity hdioldirqafg emin5_ occupied unknown, robust
outreg2 using unknowns.doc, word dec(2) append  label

**No Muslimgroups**
xtgee logdead1 religiousgroup ddbyyear ethnicity  cibyyear hdioldirqafg emin5_ occupied unknown, robust
outreg2 using nomuslimgroup.doc, word dec(2)  label
xtgee logdead1 religiousgroup ethnoreligious ddbyyear ethnicity cibyyear  hdioldirqafg emin5_ occupied unknown, robust
outreg2 using nomuslimgroup.doc, word dec(2) append  label
xtgee logdead1 religiousgroup fund ddbyyear ethnicity cibyyear hdioldirqafg emin5_ occupied unknown, robust
outreg2 using nomuslimgroup.doc, word dec(2) append  label

**No CI**
xtgee logdead1 religiousgroup muslimgroups ddbyyear ethnicity  hdioldirqafg emin5_ occupied unknown, robust
outreg2 using noCI.doc, word dec(2)  label
xtgee logdead1 religiousgroup ethnoreligious muslimgroups ddbyyear ethnicity  hdioldirqafg emin5_ occupied unknown, robust
outreg2 using noCI.doc, word dec(2) append  label
xtgee logdead1 religiousgroup fund muslimgroups ddbyyear ethnicity hdioldirqafg emin5_ occupied unknown, robust
outreg2 using noCI.doc, word dec(2) append  label

**alternate models**

**nbreg**
nbreg dead religiousgroup muslimgroups ddbyyear ethnicity cibyyear hdioldirqafg emin5_ occupied unknown, cluster(orgid)
outreg2 using nbreg.doc, word dec(2)label
nbreg dead religiousgroup ethnoreligious muslimgroups ddbyyear ethnicity cibyyear hdioldirqafg emin5_ occupied unknown, cluster(orgid)
outreg2 using nbreg.doc, word dec(2) append label
nbreg dead religiousgroup fund muslimgroups ddbyyear cibyyear ethnicity hdioldirqafg emin5_ occupied unknown, cluster(orgid)
outreg2 using nbreg.doc, word dec(2) append label
nbreg dead ethnoreligious  muslimgroups ddbyyear cibyyear ethnicity hdioldirqafg emin5_ occupied unknown, cluster(orgid)
outreg2 using nbreg.doc, word dec(2) append label
nbreg dead fund  muslimgroups ddbyyear cibyyear ethnicity hdioldirqafg emin5_ occupied unknown, cluster(orgid)
outreg2 using nbreg.doc, word dec(2) append label

**reg**
reg logdead1 religiousgroup muslimgroups ddbyyear ethnicity cibyyear hdioldirqafg emin5_ occupied unknown, cluster(orgid)
outreg2 using reg.doc, word dec(2)label
reg logdead1 religiousgroup ethnoreligious muslimgroups ddbyyear ethnicity cibyyear hdioldirqafg emin5_ occupied unknown, cluster(orgid)
outreg2 using reg.doc, word dec(2) append label
reg logdead1 religiousgroup fund muslimgroups ddbyyear cibyyear ethnicity hdioldirqafg emin5_ occupied unknown, cluster(orgid)
outreg2 using reg.doc, word dec(2) append label
reg logdead1 ethnoreligious  muslimgroups ddbyyear cibyyear ethnicity hdioldirqafg emin5_ occupied unknown, cluster(orgid)
outreg2 using reg.doc, word dec(2) append label
reg logdead1 fund  muslimgroups ddbyyear cibyyear ethnicity hdioldirqafg emin5_ occupied unknown, cluster(orgid)
outreg2 using reg.doc, word dec(2) append label

**logit for success**
logit success religiousgroup muslimgroups ddbyyear ethnicity cibyyear hdioldirqafg emin5_ occupied unknown, cluster(orgid)
outreg2 using logit.doc, word dec(2)label


**mlogit**
mlogit target religiousgroup muslimgroups ddbyyear ethnicity cibyyear hdioldirqafg emin5_ occupied unknown, cluster(orgid) b(1)
outreg2 using mlogit.doc, word dec(2)label


**Graph of clustered deaths by terrorist group**
scatter logdead1 orgid, xlabel(0) xline(9 10 24 25 42 54 55) xtitle("Terrorist Group") ytitle("Logged Deaths from Suicide Attacks")

**substantive significance of religious group in each model, using alternate sheet from Excel**
**use Excel files.**
 twoway (bar mean model) (rcap  CIUpper  CILower model), ysc (range(0 130)) ytitle(Per Cent Increase in Fatalities) x
 
**religious versus non-religious deaths**
**maybe make in Excel to show the three next to each other**
graph bar dead, over (religiousgroup)
graph bar dead, over (ethnoreligious)
graph bar dead, over (intertrans)






